package com.findviewbydream.evil.helloyouth.Fragment;

import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.findviewbydream.evil.helloyouth.R;
import com.findviewbydream.evil.helloyouth.View.Dialog.CustomDialog.CustomDialog;
import com.mmga.metroloading.MetroLoadingView;


/********************************************
 * 工程名：HelloYouth
 * 包名：com.findviewbydream.evil.helloyouth.Fragment
 * 时间：16-6-8 下午1:04
 * 作者：白雨濃 evil
 * 邮箱：evilbai@foxmail.com
 * 内容：
 ********************************************/
public class Fragment2 extends Fragment implements View.OnClickListener
{
    private View view;
    private static Fragment2 fragment2;

    private TextView textView;
    private Button button;
    private MetroLoadingView metroLoadingView;
    private Button button3;
    private ImageView imageView;

    public static Fragment2 newInstance()
    {
        if (fragment2 == null)
            fragment2 = new Fragment2();
        return fragment2;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
    {
        view = inflater.inflate(R.layout.test, container, false);
        initView(view);
        return view;
    }

    private void initView(View view)
    {
        button3 = (Button) view.findViewById(R.id.button3);
        button3.setOnClickListener(this);
        imageView = (ImageView) view.findViewById(R.id.imageView);
        imageView.setOnClickListener(this);
    }

    @Override
    public void onPause()
    {
        super.onPause();
    }

    @Override
    public void onClick(View v)
    {
        switch (v.getId())
        {
            case R.id.button3:
                CustomDialog.builder(getContext()).setTitle("标题")
                        .setPositiveButton("确认", new DialogInterface.OnClickListener()
                        {
                            @Override
                            public void onClick(DialogInterface dialogInterface, int i)
                            {

                            }
                        })
                        .setNeutralButton("中立", new DialogInterface.OnClickListener()
                        {
                            @Override
                            public void onClick(DialogInterface dialogInterface, int i)
                            {

                            }
                        })
                        .setNegativeButton("取消", new DialogInterface.OnClickListener()
                        {
                            @Override
                            public void onClick(DialogInterface dialogInterface, int i)
                            {

                            }
                        }).show();
                break;
        }
    }
}
